<template>
    <div>
        <van-nav-bar title="Q享生活"  left-arrow   @click-left="$router.go(-1)"></van-nav-bar>
        <div class="commun-bg">
        <!-- 单项联选择器 -->
            <div class="commun-box">
                <div class="cardNumber">{{cardObj.walletNumber}}</div>
                <div class="integral">
                    <p class="fl">积分：<label >{{cardObj.walletIntegral}}</label></p>
                    <p class="fr">开卡时间：<label >{{cardObj.createDate}}</label></p>
                </div>  
            </div>
            <div class="commun-boxTow activs">
                <!-- 我的积分 -->
                <div class="party">
                    <div class="fl party-img">
                        <span>我的积分</span>
                    </div>
                    <div class="fr inte">{{cardObj.walletIntegral}}</div>
                </div>
                <!-- 积分记录 -->
                <div class="party" @click="oNrecord">
                    <div class="fl party-img">
                        <span>积分记录</span>
                    </div>
                    <div class="fr ">
                        <b class="right"><i class="right-arrow1"></i><i class="right-arrow2"></i></b>
                    </div>
                </div>
                <!-- 积分规则 -->
                <div class="party" @click="oNrules">
                    <div class="fl party-img">
                        <span>积分规则</span>
                    </div>
                    <div class="fr ">
                        <b class="right"><i class="right-arrow1"></i><i class="right-arrow2"></i></b>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import apiHttp from '../../api/index'
import { Toast } from 'vant';
export default {
    data() {
        return {
            cardNumber:"",
            totalScore:"",
            data:"",
            integral:"",
            userId:sessionStorage.getItem('userId'),
            cardObj:{}
        }
    },
    mounted(){
        this.getMyWallet()
    },
    methods:{
        getMyWallet(){
            let parmes = {
                userId:this.userId
            }
            apiHttp.comIndex.getMyWallet(parmes,resp=>{
                if(resp.resultCode == '000000'){
                    resp.data.older.createDate = resp.data.older.createDate.slice(0,10)
                    this.cardObj = resp.data.older
                }else{
                  Toast(resp.resultMsg)
                }
            })
        },
        // 积分记录
        oNrecord(){
            this.$router.push({path:"./ComList/listQlife/oNrecord"});
        },
        // 积分规则
        oNrules(){
            this.$router.push({path:"./ComList/listQlife/oNrules"});
        },
    }
}
</script>
<style scoped>
    @import '../../assets/css/community/life.css';
</style>

